package com.pennysaver.adaptor;

import java.util.Calendar;

import com.pennysaver.dao.UserDao;
import com.pennysaver.model.UserModel;

public class UserAdaptor extends PennysaverAdaptor {

	public boolean registerUser(String userName, String firstName,
			String lastName, String emailAddress, String birthDate,
			String birthMonth, String birthYear) {

		UserDao userdao = dao.getUserDao();
		Calendar birthDay = Calendar.getInstance();
		birthDay.set(Integer.parseInt(birthYear), Integer.parseInt(birthMonth),
				Integer.parseInt(birthDate));
		UserModel user = new UserModel(userName, firstName, lastName,
				emailAddress, birthDay.getTime());
		userdao.createUser(user);
		return true;
	}

}
